<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch benben-position-layout flex myPoints_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }"
			>
				<view class='flex flex-wrap align-center justify-between myPoints_fd0_0'>
					<view
						class='flex flex-wrap align-center myPoints_fd0_0_c0'
						@tap.stop="handleJumpDiy"
						data-type="back"
						data-url="1"
					>
						<text class='fu-iconfont2  myPoints_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text
							class='myPoints_fd0_0_c1_c0'
							style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;"
						>我的积分</text>
					</view>
					<view class='flex align-center justify-end myPoints_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout myPoints_flex_1">
				<view class='flex flex-direction flex-wrap align-stretch myPoints_fd1_0'>
					<view class='flex flex-wrap align-center justify-center myPoints_fd1_0_c0'>
						<view class='flex flex-direction flex-wrap align-center'>
							<text class='myPoints_fd1_0_c0_c0_c0' style="font-family: SF Pro Text, SF Pro Text;">{{score}}</text>
							<text class='myPoints_fd1_0_c0_c0_c1' style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;">当前积分</text>
						</view>
					</view>
					<view
						class='flex flex-wrap align-center justify-center myPoints_fd1_0_c1'
						@tap.stop="handleJumpDiy"
						data-type="navigateTo"
						:data-url="`/pages/grzx/pointsRanking/pointsRanking`"
					>
						<text class='myPoints_fd1_0_c1_c0' style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;">排行榜</text>
					</view>
				</view>
				<view
					class='flex flex-wrap align-center justify-between myPoints_fd1_1'
					@tap.stop="handleJumpDiy"
					data-type="navigateTo"
					:data-url="`/pages/grzx/inteDetails/inteDetails`"
				>
					<text class='myPoints_fd1_1_c0' style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;">近30天记录</text>
					<view class='flex flex-wrap align-center'>
						<text class='myPoints_fd1_1_c1_c0' style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;">查看更多</text>
						<image
							class='myPoints_fd1_1_c1_c1'
							mode="aspectFit"
							:src='STATIC_URL+"660.png"'
						></image>
					</view>
				</view>
			</view>

			<view
				class="loading_css"
				v-if="isShow"
			>
				<u-loading
					size="36"
					color="#AD3823"
				></u-loading>
				<view>加载中</view>
			</view>
			<block v-else>
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
					<view
						class='flex flex-direction flex-wrap align-stretch myPoints_fd2_0'
						v-for="(v ,k ) in list"
						:key="k"
					>
						<view class='flex flex-wrap align-center myPoints_fd2_0_c0'>
							<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
								<view class='flex flex-wrap align-center myPoints_fd2_0_c0_c0_c0'>
									<text class='myPoints_fd2_0_c0_c0_c0_c0' style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;">{{v.title}}</text>
								</view>
								<view class='flex flex-wrap align-center myPoints_fd2_0_c0_c0_c1'>
									<text class='myPoints_fd2_0_c0_c0_c1_c0' style="font-family: SF Pro Text, SF Pro Text;">{{v.create_time}}</text>
								</view>
							</view>
							<view
							style="font-family: SF Pro Text, SF Pro Text;"
								class='flex flex-wrap align-center myPoints_fd2_0_c0_c1'
								v-if="v.change_score >= 0"
							>
								<text class='myPoints_fd2_0_c0_c1_c0'>+</text>
								<text class='myPoints_fd2_0_c0_c1_c0'>{{v.change_score}}</text>
							</view>
							<view
							style="font-family: SF Pro Text, SF Pro Text;"
								class='flex flex-wrap align-center myPoints_fd2_0_c0_c1'
								v-else
							>
								<text class='myPoints_fd2_0_c1_c1_c0'>{{v.change_score}}</text>
							</view>
						</view>
					</view>
					<view class="loadmore">
						<u-loadmore
							v-if="last_page > 1"
							font-size="24"
							:status="status"
							:icon-type="iconType"
							:load-text="loadText"
						/>
					</view>
				</view>
			</block>

			<view
				class="noData_other"
				v-if="list.length == 0 && !isShow"
			>
				<image :src='STATIC_URL+"no.png"'></image>
			</view>

		</view>
	</view>
</template>
<script>
	export default {
		components: {},


		data() {
			return {
				score: 0, // 积分
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
			this.getData();
		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {

				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getList();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			// 我的积分  
			getData() {
				this.$api.post(global.API_VERSION + '5c78c4772da97', {

				}).then(res => {
					if (res.data.code == 1) {
						this.score = res.data.data.score;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			// 30天记录  6551d627093bc
			getList() {
				this.$api.post(global.API_VERSION + '6551d627093bc', {
					page: this.page
				}).then(res => {
					console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 1) {
						this.last_page = res.data.data.last_page;
						if (this.is_pull) {
							this.list = res.data.data.data;
						} else {
							this.list = this.list.concat(res.data.data.data);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
		}
	};
</script>
<style
	lang="scss"
	scoped
>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://www.guochaoxiaoju.com/uploads/mini/618.png) no-repeat;
		background-size: 100% auto;
	}

	.myPoints_flex_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/618.png) no-repeat;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.myPoints_fd0_0_c1_c0 {
		font-size: 40rpx;
		font-weight: 400;
		color: #FFFFFF;
	}

	.myPoints_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #fff;
		font-weight: 500;
	}

	.myPoints_fd0_0_c0 {
		width: 150rpx;
	}

	.myPoints_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.myPoints_flex_1 {
		padding: 20rpx 0rpx 0rpx 0rpx;
	}

	.myPoints_fd1_1_c1_c1 {
		width: 9rpx;
		height: 16rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.myPoints_fd1_1_c1_c0 {
		color: #E3E3E3;
		font-size: 26rpx;
		font-weight: 400;
		line-height: 53rpx;
		margin: 0rpx 15rpx 0rpx 0rpx;
	}

	.myPoints_fd1_1_c0 {
		color: #FFFFFF;
		font-size: 40rpx;
		font-weight: 400;
	}

	.myPoints_fd1_1 {
		padding: 26rpx 30rpx 33rpx 30rpx;
	}

	.myPoints_fd1_0_c1_c0 {
		color: #FFFFFF;
		font-size: 28rpx;
		font-weight: 400;
	}

	.myPoints_fd1_0_c1 {
		background: rgba(255, 255, 255, 0.2);
		border-radius: 100rpx 0rpx 0rpx 100rpx;
		width: 144rpx;
		height: 56rpx;
		box-shadow: 0rpx 3rpx 6rpx rgba(105, 14, 0, 0.2)rpx rgba(105, 14, 0, 0.2);
		position: absolute;
		top: 50rpx;
		right: 0rpx;
	}

	.myPoints_fd1_0_c0_c0_c1 {
		color: #FFFFFF;
		font-size: 36rpx;
		font-weight: 400;
		margin: 20rpx 0rpx 0rpx 0rpx;
	}

	.myPoints_fd1_0_c0_c0_c0 {
		color: #FFFFFF;
		font-size: 64rpx;
		font-weight: 600;
	}

	.myPoints_fd1_0_c0 {
		padding: 44rpx 0rpx 23rpx 0rpx;
	}

	.myPoints_fd1_0 {
		position: relative;
	}

	.myPoints_fd2_0_c1_c1_c0 {
		font-size: 32rpx;
		font-weight: 700;
		color: var(--benbenFontColor0);
	}

	.myPoints_fd2_0_c1_c0_c1_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(191, 191, 191, 1);
	}

	.myPoints_fd2_0_c0_c1_c0 {
		font-size: 32rpx;
		font-weight: 700;
		color: var(--benbenFontColor6);
	}

	.myPoints_fd2_0_c0_c1 {
		margin: 0rpx 0rpx 0rpx auto;
	}

	.myPoints_fd2_0_c0_c0_c1_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
	}

	.myPoints_fd2_0_c0_c0_c1 {
		margin: 16rpx 0rpx 0rpx 0rpx;
	}

	.myPoints_fd2_0_c0_c0_c0_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
	}

	.myPoints_fd2_0_c0_c0_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.myPoints_fd2_0_c0 {
		border-bottom: 1px solid #eee;
		background: #FFFFFF;
		padding: 32rpx 24rpx 32rpx 24rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		width: 690rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.myPoints_fd2_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}
</style>